Skip to content

block: genhd: Add NULL check for kobject_create_and_add in genhd_device_init#964

Open
blktests-ci[bot] wants to merge 2 commits into
linus-master_basefrom
series/1111616=>linus-master
Open

block: genhd: Add NULL check for kobject_create_and_add in genhd_device_init#964
blktests-ci[bot] wants to merge 2 commits into
linus-master_basefrom
series/1111616=>linus-master

Conversation

@blktests-ci

@blktests-ci blktests-ci Bot commented Jun 15, 2026

Copy link
Copy Markdown

Pull request for series with
subject: block: genhd: Add NULL check for kobject_create_and_add in genhd_device_init
version: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=1111616

@blktests-ci

blktests-ci Bot commented Jun 15, 2026

Copy link
Copy Markdown
Author

Upstream branch: 062871f
series: https://patchwork.kernel.org/project/linux-block/list/?series=1111616
version: 1

@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch 2 times, most recently from 199644a to e6d9eb8 Compare June 17, 2026 12:02
@blktests-ci

blktests-ci Bot commented Jun 17, 2026

Copy link
Copy Markdown
Author

Upstream branch: 66affa3
series: https://patchwork.kernel.org/project/linux-block/list/?series=1111616
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1111616=>linus-master branch from e8654c0 to 352c9dd Compare June 17, 2026 12:23
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from e6d9eb8 to 7d8604f Compare June 24, 2026 01:11
@blktests-ci

blktests-ci Bot commented Jun 24, 2026

Copy link
Copy Markdown
Author

Upstream branch: bade58e
series: https://patchwork.kernel.org/project/linux-block/list/?series=1111616
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1111616=>linus-master branch from 352c9dd to 76fc032 Compare June 24, 2026 01:33
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 7d8604f to 4cc45a3 Compare June 26, 2026 08:14
@blktests-ci

blktests-ci Bot commented Jun 26, 2026

Copy link
Copy Markdown
Author

Upstream branch: 4edcdef
series: https://patchwork.kernel.org/project/linux-block/list/?series=1111616
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1111616=>linus-master branch from 76fc032 to 4be3481 Compare June 26, 2026 08:52
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 4cc45a3 to 90ffd56 Compare June 29, 2026 17:14
@blktests-ci

blktests-ci Bot commented Jun 29, 2026

Copy link
Copy Markdown
Author

Upstream branch: dc59e4f
series: https://patchwork.kernel.org/project/linux-block/list/?series=1111616
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1111616=>linus-master branch from 4be3481 to bd9c14b Compare June 29, 2026 17:56
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 90ffd56 to d52f35a Compare July 2, 2026 19:18
@blktests-ci

blktests-ci Bot commented Jul 2, 2026

Copy link
Copy Markdown
Author

Upstream branch: 87320be
series: https://patchwork.kernel.org/project/linux-block/list/?series=1111616
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1111616=>linus-master branch from bd9c14b to 5615f6f Compare July 2, 2026 19:54
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from d52f35a to a644c13 Compare July 6, 2026 08:28
@blktests-ci

blktests-ci Bot commented Jul 6, 2026

Copy link
Copy Markdown
Author

Upstream branch: 8cdeaa5
series: https://patchwork.kernel.org/project/linux-block/list/?series=1111616
version: 1

…ce_init

The kobject_create_and_add() call in genhd_device_init() may return NULL
if memory allocation fails, but the return value was not being checked.
This could lead to NULL pointer dereferences in subsequent calls to
sysfs_create_link() and sysfs_remove_link() which use block_depr.

Add proper error checking and cleanup path to handle the case when
kobject_create_and_add() fails.

Fixes: 721da5c ("driver core: remove CONFIG_SYSFS_DEPRECATED
	and CONFIG_SYSFS_DEPRECATED_V2")
Signed-off-by: Li Jun <lijun01@kylinos.cn>
@blktests-ci blktests-ci Bot force-pushed the series/1111616=>linus-master branch from 5615f6f to e8df0fb Compare July 6, 2026 09:32
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from a644c13 to a2204c3 Compare July 7, 2026 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant